package org.apache.jsp.manager.category;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;

public final class CategoryUpdate_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=euc-kr");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<SCRIPT language=\"JavaScript\">\r\n");
      out.write("\r\n");
      out.write("\t\r\n");
      out.write("\r\n");
      out.write("\tvar cont;\r\n");
      out.write("\tvar table;\r\n");
      out.write("\tvar oTable;\r\n");
      out.write("\tvar oTBody;\r\n");
      out.write("\tvar oRow;\r\n");
      out.write("\tvar oTd;\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\twindow.onload = function()\r\n");
      out.write("\t{\r\n");
      out.write("\t\tdocument.addForm.cate1.select();\r\n");
      out.write("\t}\r\n");
      out.write("\t\r\n");
      out.write("\tfunction addFiles()\r\n");
      out.write("\t{\r\n");
      out.write("\t\t\r\n");
      out.write("\t\tcont  = document.getElementById('cont');\r\n");
      out.write("\t\t\r\n");
      out.write("\r\n");
      out.write("\t\tif(cont.all.length/5 >= 5)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t    \twindow.alert(\"하위카테고리는 최대5개까지만 추가가능합니다.\");\r\n");
      out.write("\t    \treturn false;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\r\n");
      out.write("\t    table = document.createElement('TABLE');\r\n");
      out.write("\t    table.id    = 'oTable';\r\n");
      out.write("\t    cont.appendChild(table);\r\n");
      out.write("\t\r\n");
      out.write("\t    oTable  = document.getElementById('oTable');\r\n");
      out.write("\t    oTable.cellSpacing ='0';\r\n");
      out.write("\t    oTable.cellPadding ='0';\r\n");
      out.write("\t    oTable.bgColor     ='gray';\r\n");
      out.write("\t    oTable.border      ='0';\r\n");
      out.write("\t    oTBody  = document.createElement('TBODY');\r\n");
      out.write("\t    oTBody.bgColor = '#FFFFFF';\r\n");
      out.write("\t    oTBody.align   = 'left';\r\n");
      out.write("\t    \r\n");
      out.write("\t    oTable.appendChild(oTBody);\r\n");
      out.write("\t\r\n");
      out.write("\t    oRow = document.createElement('TR');\r\n");
      out.write("\t    oTBody.appendChild(oRow);\r\n");
      out.write("\r\n");
      out.write("\t    oCell = document.createElement('TD');\r\n");
      out.write("\t    \r\n");
      out.write("\t    var until = cont.all.length/5;\r\n");
      out.write("\t\tfor(i=0 ; i<until; i++)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t  \t  oCell.innerHTML = \"<input type='text' name='cate2' style='width:99px;'>\";\r\n");
      out.write("\t\t}\r\n");
      out.write("\t    oRow.appendChild(oCell);\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\t\tvar fr = document.addForm;\r\n");
      out.write("\t\t\r\n");
      out.write("\r\n");
      out.write("\t\tif(cont.all.length ==5)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t \t   fr.cate2.focus();\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\telse if(cont.all.length > 5)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t    if(fr.cate2[0].value != null)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t    \tfr.cate2[1].focus();\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t    if(fr.cate2[1].value != null)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t    \tfr.cate2[2].focus();\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t    if(fr.cate2[2].value != null)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t    \tfr.cate2[3].focus();\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t    if(fr.cate2[3].value != null)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t    \tfr.cate2[4].focus();\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tfunction addAction()\r\n");
      out.write("\t{\r\n");
      out.write("\t\t\r\n");
      out.write("\t\tvar f = document.addForm;\r\n");
      out.write("\t\tif(trim(f.cate1.value)==\"\")\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\twindow.alert(\"상위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\tf.cate1.focus();\r\n");
      out.write("\t\t\treturn false;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\tif(cont != null)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\tif(cont.all.length ==5)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t\t\tif(trim(f.cate2.value)==\"\" )\r\n");
      out.write("\t\t\t\t{\r\n");
      out.write("\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\tf.cate2.focus();\r\n");
      out.write("\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\tif(cont.all.length >5)\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t\t\tif(trim(f.cate2[0].value)==\"\")\r\n");
      out.write("\t\t\t\t{\r\n");
      out.write("\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\tf.cate2[0].focus();\r\n");
      out.write("\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t}\t\t\t\r\n");
      out.write("\t\t\t\tif(trim(f.cate2[1].value)==\"\")\r\n");
      out.write("\t\t\t\t{\r\n");
      out.write("\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\tf.cate2[1].focus();\r\n");
      out.write("\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\t\r\n");
      out.write("\t\t\t\tif(cont.all.length >10)\r\n");
      out.write("\t\t\t\t{\t\r\n");
      out.write("\t\t\t\t\tif(trim(f.cate2[2].value)==\"\")\r\n");
      out.write("\t\t\t\t\t{\r\n");
      out.write("\t\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\t\tf.cate2[2].focus();\r\n");
      out.write("\t\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t\t}\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\tif(cont.all.length >15)\r\n");
      out.write("\t\t\t\t{\r\n");
      out.write("\t\t\t\t\tif(trim(f.cate2[3].value)==\"\")\r\n");
      out.write("\t\t\t\t\t{\r\n");
      out.write("\t\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\t\tf.cate2[3].focus();\r\n");
      out.write("\t\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t\t}\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\tif(cont.all.length >20)\r\n");
      out.write("\t\t\t\t{\r\n");
      out.write("\t\t\t\t\tif(trim(f.cate2[4].value)==\"\")\r\n");
      out.write("\t\t\t\t\t{\r\n");
      out.write("\t\t\t\t\t\twindow.alert(\"추가한 하위카테고리는 반드시 입력하여야 합니다.\");\r\n");
      out.write("\t\t\t\t\t\tf.cate2[4].focus();\r\n");
      out.write("\t\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t\t}\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\tf.categoryLength.value = cont.all.length/5;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\r\n");
      out.write("\t\tf.cate1.value = trim(f.cate1.value);\r\n");
      out.write("\t\tf.submit();\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tfunction remove()\r\n");
      out.write("\t{\r\n");
      out.write("\t\tvar f = document.addForm;\r\n");
      out.write("\t\tf.func.value=\"category_002\";\r\n");
      out.write("\t\tf.submit();\r\n");
      out.write("\t}\r\n");
      out.write("\t\r\n");
      out.write("\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<CENTER>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR><TD height=\"15\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#7682EB\">\r\n");
      out.write("\t\t<TR>\r\n");
      out.write("\t\t\t<TD align=\"center\" bgcolor=\"#E4F2FC\" width=\"150\">\r\n");
      out.write("\t\t\t\t<FONT color=\"#1115AA\" size=\"3\"><B>카테고리 추가</B></FONT>\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t</TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR><TD height=\"15\" width=\"350\"></TD></TR>\r\n");
      out.write("\t\t<TR><TD> ** 추가할 카테고리의 이름을 입력하세요.</TD></TR>\r\n");
      out.write("\t\t<TR><TD height=\"5\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"1\" cellpadding=\"4\" bgcolor=\"#7682EB\" width=\"450\">\r\n");
      out.write("\t\t<FORM name=\"addForm\" method=\"post\" action=\"/servlet/service.CategoryManagerServlet\" onSubmit=\"addAction(); return false;\">\r\n");
      out.write("\t\t\t<INPUT type=\"hidden\" name=\"func\" value=\"category_003\">\r\n");
      out.write("\t\t\t<INPUT type=\"hidden\" name=\"categoryLength\" value=\"0\">\r\n");
      out.write("\t\t\t<TR>\r\n");
      out.write("\t\t\t\t<TD bgcolor=\"#CFDDFA\" align=\"center\" ><B>상위카테고리</B></TD>\r\n");
      out.write("\t\t\t\t<TD bgcolor=\"#CFDDFA\" align=\"center\"><B>하위카테고리</B></TD>\r\n");
      out.write("\t\t\t\t<TD bgcolor=\"#CFDDFA\" align=\"center\"><B>하위카테고리추가</B></TD>\r\n");
      out.write("\t\t\t</TR>\r\n");
      out.write("\t\t\t<TR>\r\n");
      out.write("\t\t\t\t<TD bgcolor=\"#FFFFFF\" align=\"center\" valign=\"top\"><INPUT type=\"text\" name=\"cate1\" size=\"15\"></TD>\r\n");
      out.write("\t\t\t\t<TD bgcolor=\"#FFFFFF\" align=\"center\">  <div id='cont'></div></TD>\r\n");
      out.write("\r\n");
      out.write("\t\t\t\t<TD  bgcolor=\"#FFFFFF\" align=\"center\">\r\n");
      out.write("\t\t\t\t\t<input type='button' onclick='addFiles();' value='추가'>\r\n");
      out.write("\t\t\t\t\t<input type='button' onclick='remove();' value='삭제'>\r\n");
      out.write("\t\t\t\t</TD>\r\n");
      out.write("\t\t\t</TR>\r\n");
      out.write("\t\t</FORM>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR><TD height=\"5\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR>\r\n");
      out.write("\t\t\t<TD align=\"center\">\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/but_reg.gif\" border=\"0\" align=\"absmiddle\" alt=\"등록\" style=\"cursor:hand\" onClick=\"addAction();\">\r\n");
      out.write("\t\t\t\t&nbsp;&nbsp;\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/but_cancel1.gif\" border=\"0\" align=\"absmiddle\" alt=\"취소\" style=\"cursor:hand\" onClick=\"window.close();\">\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t</TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR><TD height=\"10\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("</CENTER>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
